package com.onlinemovies.repository;

import java.io.Serializable;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public class AbstractRepository<E> implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@PersistenceContext
	protected EntityManager entityManager;
	
	public E persist(E e){
		entityManager.persist(e);
		return e;
	}

	public E merge(E e) {
	    return entityManager.merge(e);
	}
	     
	public void remove(E e) {
	    entityManager.remove(e);
	}
	     
}
